home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: How to tell if a file exists in C
- Date: Thu, 22 Feb 96 22:58:05 GMT
- Organization: none
- Message-ID: <825029885snz@genesis.demon.co.uk>
- References: <4eqkj6$ipo@charm.magnus.acs.ohio-state.edu> <4eqn9q$dr1@sparcserver.lrz-muenchen.de> <3121db3e.43150046@nntp.ix.netcom.com> <4ftpnk$i74@cafu.fl.net.au> <824493561snz@genesis.demon.co.uk> <4g8132$mg9@cafu.fl.net.au> <4ggsa4$cdp@news.manawatu.gen.nz>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4ggsa4$cdp@news.manawatu.gen.nz>
- ctutty@manawatu.gen.nz "Chris Tutty" writes:
-
- >als@fl.net.au (Andrew Snow) wrote:
- >>Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
- >>>In article <4ftpnk$i74@cafu.fl.net.au> als@fl.net.au "Andrew Snow" writes:
- >>>>If you want to see if the file is readable as well as exists,
- >>>Can a file be readable yet not exist?
- >>No, but did you really want me to spell it out? You ought to have
- >>been able to figure it out. Sorry if you couldn't.
- >>
- >That's what I need!!! :-) Non-existent readable files. Simplify your
- >testing, avoid cluttering your hard drive with files called
- >TEMP001.TMP!. Yeah!
-
- That is already possible in, say, Unix where a file can exist
- without a link (i.e. an entry in the directory structure). tmpfile()
- might generate such a file. However it still isn't something that would
- register for R_OK but not F_OK with access().
-
- ...
-
- >Well, actually I know what you mean, but I'm not sure that Mr Kirby's
- >'Can a file be readable but not exist' is actually impossible. I
- >remember a situation connecting to a server from Windows where a user
- >could save files to the server, but didn't have rights to view the
- >directory. The file was writable (and therefore readable)
-
- It doesn't follow in general that writable files are readable (although
- it may do on a particular system).
-
- >as long as
- >it was open, but once closed, it no longer existed for that person.
-
- However as soon as it ceases to exist it ceases to be readable.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-